<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>获取元素对象</title>
</head>
<body>

    <img id="off" src="img/off.gif">
    <h1 id="title">悔创阿里杰克马</h1>

<script>
    // //通过id获取元素对象
    // var off = document.getElementById("off");
    // alert(off);
    // off.src = "img/on.gif";

    //获取h1标签对象
    var title = document.getElementById("title");
    alert("我要换内容了");
    title.innerHTML = "不识妻美刘强东";
</script>

</body>
</html>